Xbasic

A5_SQLResultSetPreview Function

Syntax

V a5_SQLResultSetPreview(P resultset [,C dialog_title [,L modal [,N width [,N height [,N maxrows [,C tablename [,L resultsetIsEmpty [,* OtherOptions [,* cn ]]]]]]]]])

Arguments

resultset

A SQL::ResultSet object.

dialog_title

Optional. Default = "". The title of the dialog box.

modal

Logical. Optional. Default = .T. Sets the mode of the dialog box. .T. = Modal .F. = Modeless

width

Numeric. Optional. Default = 100. The width of the dialog box in characters.

height

Numeric. Optional. Default = 20. The height of the dialog box in lines.

maxrows

Numeric. Optional. Default = 100. Not changeable. The number of rows of data to display.

tablename

Optional. Default = "Table ". Used for the dialog title if Title is NULL. Character

resultsetIsEmpty

Logical. Optional. Default = .F.

OtherOptions

*

cn

*

Description

The A5_SQLResultSetPreview() function displays up to 100 rows of data stored in a SQL::ResultSet object.

Displays an Xdialog showing the data in an SQL Result set. If Cn (sql::connection) is passed in, the Resultset is freed immediately so as not to hold any server locks in place.

DIM conn as SQL::Connection
DIM cs as C
dim qry as SQL::Query
dim SQL as C
DIM rs as SQL::ResultSet
cs = "{A5API='Access', A5Syntax='Access', FileName='C:\Program Files\a5v6\MDBFiles\Alphasports.mdb', UserName='Admin'}"
SQL = "select * from customer"
if (conn.Open(cs)) then
    if (qry.Parse(SQL)) then
        if (qry.Execute(conn)) then
            rs = qry.ResultSet
            A5_SQLResultSetPreview(rs)
        end if
    end if
end if

Limitations

Desktop applications only.

See Also